package com.tuanzi.loan.web.lazy.pageTemplate;

import com.tuanzi.loan.business.service.pageTemplate.LoanPageTemplateInfoService;
import com.tuanzi.loan.core.lazy.BaseLazyDataModel;
import com.tuanzi.loan.core.util.SpringContextHolder;
import com.tuanzi.loan.core.vo.PageSearcher;
import com.tuanzi.loan.vo.request.pageTemplate.LoanPageTemplateInfoRequest;
import com.tuanzi.loan.vo.response.pageTemplate.LoanPageTemplateInfoResponse;
import org.springframework.data.domain.Page;

/**
 * @Auther: hequnayu
 * @Date: 2019/9/17 11:23
 * @Description:
 */
public class LoanPageTemplateInfoLazyDataModel extends BaseLazyDataModel<LoanPageTemplateInfoRequest, LoanPageTemplateInfoResponse> {

    private static final long serialVersionUID = 1845044497773265115L;
    LoanPageTemplateInfoService loanPageTemplateInfoService = SpringContextHolder.getBean(LoanPageTemplateInfoService.class);
    public LoanPageTemplateInfoLazyDataModel(LoanPageTemplateInfoRequest loanPageTemplateInfoRequest) {
        super(loanPageTemplateInfoRequest);
    }

    @Override
    protected Page<LoanPageTemplateInfoResponse> doLoad(PageSearcher<LoanPageTemplateInfoRequest> pageSearcher) {
        return loanPageTemplateInfoService.list(pageSearcher);
    }
}
